glarea: Make the code snippet compile
authorTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 11:26:59 +0000 (13:26 +0200)
committerTimm Bäder <mail@baedert.org>
Thu, 12 Oct 2017 13:42:03 +0000 (15:42 +0200)
gtk/gtkglarea.c

index c3135187ef34af980d80656bb79bf7f3e479ac4f..5cbbe5e5643fe784ae73fff872f88b0932030179 100644 (file)
  * create a widget instance and connect to the #GtkGLArea::render signal:
  *
  * |[<!-- language="C" -->
- *   // create a GtkGLArea instance
- *   GtkWidget *gl_area = gtk_gl_area_new ();
- *
- *   // connect to the "render" signal
- *   g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
+
  * ]|
  *
  * The `render()` function will be called when the #GtkGLArea is ready
  *     glClear (GL_COLOR_BUFFER_BIT);
  *
  *     // draw your object
- *     draw_an_object ();
+ *     // draw_an_object ();
  *
  *     // we completed our drawing; the draw commands will be
  *     // flushed at the end of the signal emission chain, and
  *     // the buffers will be drawn on the window
  *     return TRUE;
  *   }
+ *
+ *   void setup_glarea (void)
+ *   {
+ *     // create a GtkGLArea instance
+ *     GtkWidget *gl_area = gtk_gl_area_new ();
+ *
+ *     // connect to the "render" signal
+ *     g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
+ *   }
  * ]|
  *
  * If you need to initialize OpenGL state, e.g. buffer objects or